home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / tman.lha / tman / manual.m4 (.txt) < prev    next >
LaTeX Document  |  1988-10-28  |  9KB  |  326 lines

  1. divert(-1)  ;-*-Outline-*-
  2. WARNING:
  3. Beware of comma, quote, quasiquote, and hash.  The claws that catch,
  4. the jaws that bite.
  5. *======== Internals - probably shouldnt be used in the body of the manual.
  6. ** ==== LaTeX, Texinfo ====
  7. These determine whether a LaTeX or a Texinfo file is output when the
  8. manual source is run through m4.
  9. Put the one you want last.
  10. define(__type,`texinfo')
  11. define(__type,`latex')
  12. __alt2 (latex-ver,texinfo-ver)
  13.   define(__alt2,
  14.   `ifelse(__type,`latex',`$1',
  15.           __type,`texinfo',`$2')')
  16. __alt3 (latex-ver,info-ver,tex-ver)
  17.  define(_alt3,
  18.   `ifelse(__type,`latex',`$1',
  19.           __type,`texinfo',`
  20. @ifinfo
  21. @end ifinfo
  22. @iftex
  23. @end tex
  24.      )')
  25. ** ==== Constructors for Latex/Tex/Info sensative commands.
  26. _include (latex-file,texinfo-file)
  27.   define(_include,
  28.    `__alt2(`include(`$1')',
  29.            `include(`$2')')')
  30. defmacro (name,latex-ver,texinfo-ver)
  31.   define(defmacro,
  32.    `errprint(`use defmacro2')')
  33. defmacro2 (name,latex-ver,texinfo-ver)
  34.   define(defmacro2,
  35.    `define($1,`__alt2(`$2',`$3')')')
  36. defmacro3 (name,latex-ver,info-ver,tex-ver)
  37.   define(defmacro3,
  38.    `define($1,`__alt3(`$2',`$3',`$4')')')
  39. defmacroEnv (name,Common-Beginning,latex-ver,info-ver,tex-ver,Common-Ending)
  40.   define(defmacroEnv,
  41.    `define($1,`__alt(`$2$3$6',`$2$4$6',`$2$5$6')')')
  42. *======== Externals - these are used in the body of the manual.
  43. ** ==== compat (equivalents)
  44. defmacro2(_horizline,`\makebox[0.5\textwidth]{\hrulefill}',
  45.   `@center -----------------------------------------------------')
  46. defmacro2(_cite,`\cite{$1}',`')
  47. defmacro2(_label,`\label{$1}',`')
  48. defmacro2(_index,`\index{$1}',`')
  49. defmacro2(_tindex,`\index{$1@_Fcode($1)}',`')
  50. defmacro2(_ix,`\ix{$1}',`')
  51. defmacro2(_iix,`\iix{$1}',`')
  52. defmacro2(_tix,`_Fcode($1)_tindex($1)',`')
  53. defmacro2(_wt,`{\mbox _Fcode($1)}',`')
  54. defmacro2(_rm,`{\rm $1}',`$1')
  55. define(_r3rs,`Revised3 Report on Scheme')
  56. defmacro2(_experimental,`\marginpar{\bf experimental}',`')
  57. defmacro2(_changing,`\marginpar{\bf changing}',`')
  58. defmacro2(_changed,`\marginpar{\bf changed}',`')
  59. defmacro2(_Ref,`\ref{$1}',`')
  60. defmacro2(_Pageref,`\pageref{$1}',`')
  61. ** ==== util
  62. ***_Comment (whatever)  WHEN COMMENTING M4 STUFF, QUOTE IT! _Comment(`stuff')
  63.   define(_Comment,`dnl')
  64. ***_DComment (whatever)
  65.   define(_DComment,`dnl')
  66. ***_Inc (filename-wo-ext)
  67.   If you change ../, also change early line in 0manual.x .
  68.   define(_Inc,`include(`../$1')')
  69. ***_IfLatex (stuff)
  70.   define(_IfLatex,`__alt2(`$1$2$3$4$5$6$7$8$9',`')')
  71. ***_IfTexinfo (stuff)
  72.   define(_IfTexinfo,`__alt2(`',`$1$2$3$4$5$6$7$8$9')')
  73. ***_IfInfo (stuff)
  74.   define(_IfInfo,`__alt3(`',`$1$2$3$4$5$6$7$8$9',`')')
  75. ***_IfTex (stuff)
  76.   define(_IfTex,`__alt3(`',`',`$1$2$3$4$5$6$7$8$9')')
  77. ** ==== organization
  78. ***_Chapter (name)
  79.   defmacro2(_Chapter,`\chapter{$1}
  80. ',`_Comment()
  81. @node $1`,' $2`,' $3`,' $4
  82. @chapter $1
  83. ***_ChapUnum (name)
  84.   defmacro2(_ChapUnum,`\chapter*{$1}
  85. ',`_Comment()
  86. @node $1`,' $2`,' $3`,' $4
  87. @unnumbered $1
  88. ***_Appendix (name)    need some change here
  89.   defmacro2(_Appendix,`\chapter{$1}
  90. ',`')
  91. ***_Section (name)
  92.   defmacro2(_Section,`\section{$1}
  93. ',`_Comment()
  94. @node $1`,' $2`,' $3`,' $4
  95. @section $1
  96. ***_SubSection (name)
  97.   defmacro2(_SubSection,`\subsection{$1}
  98. ',`_Comment()
  99. @node $1`,' $2`,' $3`,' $4
  100. @subsection $1
  101. ***_SubSubSection (name)
  102.   defmacro2(_SubSubSection,`',`')
  103. ** ==== formating commands
  104. defmacro2(_sub,`_a(`$1',`$_{\hbox{$2}}$')',`$1<sub>$2')
  105. defmacro2(_sup,`_a(`$1',`$^{\hbox{$2}}$')',`$1<tothe>$2<th>')
  106. ***_a? append
  107.   define(_a,$1$2$3$4$5$6$7$8$9)
  108. ***_R  refill
  109.   defmacro2(_R,`',`@refill')
  110. ***_NoSp  @:
  111.   defmacro2(_NoSp,`',`@:')
  112. ***_Period @.
  113.   defmacro2(_Period,`',`@.')
  114. ***_NL
  115.   defmacro2(_NL,`',`@*')
  116.   defmacro2(_LNL,`\\',`')
  117. ** ==== font
  118. define(_tc,`_Ftt(`$1$2$3$4$5$6$7$8$9')')
  119. define(_wt,`_Xc(`$1$2$3$4$5$6$7$8$9')')
  120. define(_em,`_Fbf(`$1$2$3$4$5$6$7$8$9')')
  121. _Fit (italic)
  122.   defmacro2(_Fit,`{\it `$1$2$3$4$5$6$7$8$9'\/}',`@t{`$1$2$3$4$5$6$7$8$9'}')
  123. _Fbf (bold)
  124.   defmacro2(_Fbf,`{\bf `$1$2$3$4$5$6$7$8$9'}',`@b{`$1$2$3$4$5$6$7$8$9'}')
  125. _Ftt (teletype)
  126.   defmacro2(_Ftt,`{\tt `$1$2$3$4$5$6$7$8$9'}',`@b{`$1$2$3$4$5$6$7$8$9'}')
  127. _Fsc (small caps)
  128.   defmacro2(_Fsc,`{\sc `$1$2$3$4$5$6$7$8$9'}',`@b{`$1$2$3$4$5$6$7$8$9'}')
  129. _Fdfn (introductory-use-of-term)
  130.   defmacro2(_dfn,`_Fit(`$1$2$3$4$5$6$7$8$9')',`@dfn{`$1$2$3$4$5$6$7$8$9'}')
  131. _Fcite (citation)
  132.   defmacro2(_Fcite,`_it(`$1$2$3$4$5$6$7$8$9')',`@cite{`$1$2$3$4$5$6$7$8$9'}')
  133. dorab: used to be \sc i changed it to \tt
  134. _Fcode (stuff)
  135.   defmacro2(_Fcode,
  136.    `{\tt `$1$2$3$4$5$6$7$8$9'}',
  137.    `@code{`$1$2$3$4$5$6$7$8$9'}')
  138. _Fsem (symantic-element)
  139.   defmacro2(_Fsem,
  140.    `{\it `$1$2$3$4$5$6$7$8$9'}',
  141.    `@var{`$1$2$3$4$5$6$7$8$9'}')
  142. ** ==== characters
  143.   defmacro2(_cAND,`\&',`&')
  144.   defmacro2(_cAT,`@',`@@')
  145.   defmacro2(_cPo,``('',``('')
  146.   defmacro2(_cPc,`)',`)')
  147.   defmacro2(_cBo,`\{',`@{')
  148.   defmacro2(_cBc,`\}',`@}')
  149.   defmacro2(_cDL,`\$',`$')
  150.   defmacro2(_cGT,`$>$',`>')
  151.   defmacro2(_cGE,`$\geq$',`>=')
  152.   defmacro2(_cH,``\#'',`#')
  153.   defmacro2(_cHT,`\verb!^!',`^')
  154.   defmacro2(_cLT,`$<$',`<')
  155.   defmacro2(_cLE,`$\leq$',`<=')
  156.   defmacro2(_cM,`$-$',`')
  157.   defmacro2(_cP,`\%',`%')
  158.   defmacro2(_cQ,`"',`"')
  159.   defmacro2(_cSL,`{$\backslash$}',`\')
  160.   defmacro2(_cTL,`$\tilde{}$',`~')
  161.   defmacro2(_cUL,`\_',`_')
  162.   defmacro2(_cVL,`$|$',`|')
  163.  DONT USE AS ARGUMENT TO ANYTHING.
  164.   define(_cQc,changequote([,])[']changequote)
  165.   define(_cQo,changequote({,}){changequote([,])[`]changequote} changequote)
  166.       If space before changequote is removed, thing breaks.
  167. ** ==== words
  168. _qu: normal double quotes
  169.  defmacro2(_qu,````$1$2$3$4$5$6$7$8$9'''',`"`$1$2$3$4$5$6$7$8$9'"')
  170. _exqu: double quotes in example environments
  171.  defmacro2(_exqu,`"`$1$2$3$4$5$6$7$8$9'"',`"`$1$2$3$4$5$6$7$8$9'"')
  172. defmacro2(_txar,`-$>$',`->')
  173. defmacro2(_evalto,`$\Longrightarrow$\ ',`==>')
  174. defmacro2(_parsesto,`$\Longrightarrow$\ ',`==>')
  175. defmacro2(_equiv,`$\equiv$',`==')
  176. defmacro2(_yl,`$\longrightarrow$\ ',`-->')
  177. defmacro2(_dots,`\ldots\ ',`@dots{}')
  178. defmacro2(_star,`$^*$\ ',`*')
  179. defmacro2(_plus,`$^+$',`+')
  180. defmacro2(_or,`$|$',`|')
  181. defmacro2(_changedto,`$\longrightarrow$\ ',`-->')
  182. define(_T,`_Fbf(T)')
  183. define(_T3,`_Fbf(T3)')
  184. define(_Tv,`_Fbf(T$1)')
  185. define(_orbit,`_Fsc(`orbit')')
  186. define(_Undefined,_Fsem(`undefined'))
  187. define(_true,`_cH()_Ftt(T)')
  188. define(_false,`_cH()_Ftt(F)')
  189. _Xw (unbreakable-stuff)
  190.   defmacro2(_Xw,
  191.    `{\mbox {`$1$2$3$4$5$6$7$8$9'}}',
  192.    `@w{`$1$2$3$4$5$6$7$8$9'}')
  193. _Xc (unbreakable-code)
  194.   define(_Xc,_Xw(`_Fcode(`$1$2$3$4$5$6$7$8$9')'))
  195. define(_example,`_Xc(`$1$2$3$4$5$6$7$8$9')')
  196. defmacro2(_char,`_a(``{\#$\backslash$}'',$1)',`#\')
  197. defmacro2(_key,`_Fcode($1)',`@key ...')
  198. ** ==== Defs
  199. see also _Desc environment
  200. defmacro2(_Comdef,`_tindex(`$1')
  201. _wt(`$3')
  202. \hfill $2
  203. ',`')
  204. defmacro2(_Comdef2,`_tindex(`$2')
  205. _wt(`$4')
  206. \hfill $3
  207. ',`')
  208. defmacro2(_Comdefb,`_tindex(`$1')
  209. _wt(`$3')
  210. \hfill $2
  211. \\ _wt(`$4')
  212. ',`')
  213. _Word (t-word,semantic-invoke,semantic-result,type,availibility)
  214.   defmacro2(_Word,
  215.    `define(XXXX,`$1')_index(`$1')',
  216.    `\code{$2 _yl $3} \unimp{$4} \unimp{$5}',
  217.    `$2 _evalto $3   $4 $5',
  218.    `undefine(`XXXX')')
  219. ** ==== Environments
  220. ***_Desc environment
  221.   defmacro2(_begin_Desc,
  222.    `_begin_Inset()',
  223.    `')
  224.   defmacro2(_end_Desc,
  225.    `_end_Inset',
  226.    `@refill')
  227. ***_Ignore environment
  228.   defmacro2(_begin_Ignore,
  229.    `_Comment(',
  230.    `_Comment(')
  231.   defmacro2(_end_Ignore,
  232.    `)',
  233.    `)')
  234. ***_Quotation environment
  235.   defmacro2(_begin_Quotation,
  236.    `\begin{unimp}
  237.    `@quotation
  238.   defmacro2(_end_Quotation,
  239.    `\end{unimp}
  240.    `@end quotation
  241. ***_Example environment
  242.   defmacro2(_begin_Example,
  243.    `\begin{codexenv}',
  244.    `@example
  245.   defmacro2(_end_Example,
  246.    `\end{codexenv}',
  247.    `@end example
  248.   defmacro2(_begin_ExampleTabular,
  249.    `\begin{codexenv}
  250.     \begin{tabular}{lll}',
  251.    `@example
  252.   defmacro2(_end_ExampleTabular,
  253.    `\end{tabular}
  254.     \end{codexenv}',
  255.    `@end example
  256.   defmacro2(_colsep,`&',`')
  257.   defmacro2(_begin_ExampleTabbing,
  258.    `{\tt \begin{tabbing}',
  259.    `@example
  260.   defmacro2(_end_ExampleTabbing,
  261.    `\end{tabbing}}',
  262.    `@end example
  263.   defmacro2(_settab,`\= ',`')
  264.   defmacro2(_gotab,`\> ',`')
  265.   defmacro2(_incrtab,`\+ ',`')
  266.   defmacro2(_decrtab,`\- ',`')
  267. ***_Display environment
  268.   defmacro2(_begin_Display,
  269.    `\begin{verse}',
  270.    `@display
  271.   defmacro2(_end_Display,
  272.    `\end{verse}',
  273.    `@end display
  274. ***_Inset environment
  275.   defmacro2(_begin_Inset,
  276.    `\begin{inset}{$1}',
  277.    `')
  278.   defmacro2(_end_Inset,
  279.    `\end{inset}',
  280.    `')
  281. ***_T3env environment
  282.   defmacro2(_begin_T3env,
  283.    `_begin_Inset
  284. _Fbf(_T3 only:)
  285.    `')
  286.   defmacro2(_end_T3env,
  287.    `_end_Inset',
  288.    `')
  289. ** ==== List Environments
  290. _Item and _Itemx
  291.   defmacro2(_Item,
  292.    `\item[{$1}]',
  293.    `@item $1')
  294.   defmacro2(_Itemx,
  295.    `\unimp{}',
  296.    `@itemx $1')
  297. _Table environment
  298.   defmacro2(_begin_Table,
  299.    `\begin{description}',
  300.    `@table @b
  301.   defmacro2(_end_Table,
  302.    `\end{description}',
  303.    `@end table
  304. _Itemize environment
  305.   defmacro2(_begin_Itemize,
  306.    `\begin{itemize}',
  307.    `@itemize
  308.   defmacro2(_end_Itemize,
  309.    `\end{itemize}',
  310.    `@end itemize
  311. * Undefining of unneeded M4 stuff. (complete?)
  312. undefine(`defmacro')
  313. undefine(`define')
  314. undefine(`divnum')
  315. undefine(`errprint')
  316. undefine(`eval')
  317. undefine(`maketemp')
  318. undefine(`substr')
  319. undefine(`syscmd')
  320. undefine(`translit')
  321. undefine(`undivert')
  322. undefine(`index')
  323. undefine(`unix')
  324. undefine(`undefine')
  325. *divert(0)
  326.